Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 18: Controlling Texture Mapping

../ch18/18fig26c.gif
Figure 18.26c

A flat elevation grid using custom texture coordinates to reverse warping and invert the San Diego Bay image as it is applied. Compare with Figure 18.26b.

18fig26c.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Shape {
    appearance Appearance {
        material Material { }
        texture ImageTexture { url "sdbaywlr.jpg" }
    }
    geometry ElevationGrid {
        xDimension 5
        zDimension 5
        xSpacing   0.2
        zSpacing   0.2
        solid      FALSE
        height [
            0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0,
            0.0, 0.0, 0.0, 0.0, 0.0
        ]
        texCoord TextureCoordinate {
            point [
                0.250 1.000, 0.375 1.000, 0.500 1.000, 0.625 1.000, 0.750 1.000,
                0.188 0.750, 0.344 0.750, 0.500 0.750, 0.656 0.750, 0.812 0.750,
                0.125 0.500, 0.312 0.500, 0.500 0.500, 0.688 0.500, 0.875 0.500,
                0.062 0.250, 0.281 0.250, 0.500 0.250, 0.719 0.250, 0.938 0.250,
                0.000 0.000, 0.250 0.000, 0.500 0.000, 0.750 0.000, 1.000 0.000
            ]
        }
    }
}